/**
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

.dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  will-change: opacity;
  pointer-events: none;

  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
  align-content: center;
  align-items: center;
}

.dialog__spinner-container,
.dialog__complete-content {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
  align-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
  transition: opacity 0.3333s cubic-bezier(0,0,0.21,1);
  padding: 24px;
}

.dialog__complete-message {
  text-align: center;

  .material-icons {
    color: #4CAF50;
    font-size: 72px;
    height: 62px;
    line-height: 62px;
    margin: 0;
  }

  .dialog__complete-title {
    @include typo-headline();
    color: #37474F;
    opacity: 0.87;
    margin: 0 0 0.6em 0;
  }

  .dialog__complete-message {
    @include typo-caption();
    width: 80%;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0.54;
  }
}

.dialog__box-content {
  will-change: opacity;
  transition: opacity 0.3333s cubic-bezier(0,0,0.21,1);
}

.dialog--pending-confirm {

  .dialog__box-content {
    opacity: 0;
    pointer-events: none;
  }

  .dialog__spinner-container {
    opacity: 1;
  }
}

.dialog--complete {

  .dialog__box-content {
    opacity: 0;
    pointer-events: none;
  }

  .dialog__spinner-container {
    opacity: 0;
  }

  .dialog__complete-content {
    opacity: 1;
  }
}

.dialog--visible {
  opacity: 1;
  pointer-events: auto;
}

.dialog__box {
  position: relative;
  padding: 24px;
  border-radius: 2px;
  background: #FFF;
  width: 280px;
  @include shadow-8dp();
  z-index: 1;
}

.dialog__title {
  @include typo-title();
  margin: 0;
  padding: 0 0 20px 0;
}

.dialog__section-title {
  @include typo-subhead();
}

.dialog__description {
  @include typo-body-1();
  margin: 0;
  padding: 0 0 20px 0;
  color: rgba(0,0,0,0.54);
}

.dialog__section {
  padding-bottom: 8px;
}

.dialog__section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.dialog__radio-divider {
  margin-bottom: 16px;
}

.dialog__button-container {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  margin-top: 24px;
  padding: 8px 8px 8px 24px;
}

.dialog__button-container .mdl-button {
  color: $dialog-button-color;
}

.dialog:before {
  content: '';
  background: rgba(0,0,0,0.57);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

@media (min-width: 600px) {
  .dialog__box {
    width: 400px;
    max-width: 400px;
  }
}
